<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="icon" href="/bitbug_favicon.ico" />
<link href="/Public/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/Public/Admin/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->


<title>添加用户</title>
</head>
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="form-member-add" enctype="multipart/form-data">
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>品牌名称：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php echo ($brand['brand_name']); ?>" placeholder="" id="member-name" name="brand_name" datatype="*2-30" nullmsg="品牌名称不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>品牌网址：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php echo ($brand['site_url']); ?>" placeholder="" id="member-tel" name="site_url" datatype="*" nullmsg="品牌网址不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    
    <div class="row cl">
      <label class="form-label col-3">附件：</label>
      <div class="formControls col-5"> <span class="btn-upload form-group">
        <input class="input-text upload-url" value="<?php echo ($brand['logo']); ?>" type="text" id="uploadfile-2" readonly  datatype="*" nullmsg="请添加logo" style="width:200px">
        <a href="javascript:void();" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 品牌logo</a>
        <input type="file" multiple name="logo" class="input-file">
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <?php if(!empty($brand)): ?><div class="row cl">
    	<div class="col-3"></div>
    	<img src="<?php echo ($brand['logo']); ?>" style="max-height: 80px;max-width: 200px;"/>
    </div>
    <input type="hidden" name="brand_id" value="<?php echo ($brand['id']); ?>"/><?php endif; ?>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>
</div>


<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/js/H-ui.js"></script> 
<script type="text/javascript" src="/Public/Admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery.form.js"></script>
<script src="http://malsup.github.io/jquery.form.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").Validform({
		tiptype:2,
		ajaxPost:true,
		showAllError:true,
		beforeSubmit:function(form){
			form.ajaxSubmit({
				type:'post',
				url:'<?php echo U("addBrand");?>',
				success:function(data){
					if(data.status == 1){
						layer.msg(data.msg,{icon:6,time:1000});
						setTimeout(function(){
							var index = parent.layer.getFrameIndex(window.name);
							parent.location.reload();
							parent.layer.close(index);
						},1000);
					}
					if(data.status == 2){
						layer.msg(data.msg);
					}
					if(data.status == 0){
						layer.msg(data.msg,{icon:5,time:1000});
					}
				}
			});
			return false;
		}
	});
});
</script>
</body>


</html>